package com.mjf.scala.chapter07

import scala.collection.mutable

/**
 * 队列和并行集合
 */
object Scala17_TestQueue {
  def main(args: Array[String]): Unit = {

    // 队列
    val que = new mutable.Queue[String]()

    que.enqueue("a", "b", "c")  // 入队列

    println(que.dequeue())    // 出队列
    println(que.dequeue())
    println(que.dequeue())

    // 并行集合
    val result1 = (0 to 100).map{case _ => Thread.currentThread.getName}
    val result2 = (0 to 100).par.map{case _ => Thread.currentThread.getName}    // 并行集合

    println(result1)
    println(result2)


  }
}
